<%@ page language="java" import="java.util.*,java.util.regex.*" pageEncoding="UTF-8"%>
<%
String nickname=session.getAttribute("nickname")==null?"":(String)session.getAttribute("nickname");
int nkNameLength=Pattern.compile("[\\u4e00-\\u9fa5]").matcher(nickname).find()?11:20;
String uNameStyle=nickname.length()>nkNameLength?"style=\"top:5px;line-height:0;\"":"";
String showNickname=nickname.length()>20?nickname.substring(0,19)+"...":nickname;
%>
	<div class="navbar navbar-inverse container-fluid" role="navigation" id="nav">
		<!--导航条-->
		<div class="navbar-header">
			<!--Logo-->
			<a class="navbar-brand" href="./">
				<img alt="SuperMap" src="">
			</a>
		</div>
		<div class="nav_links">
			<div class="btn-group">
				<a class='btn <%=request.getServletPath().equals("/index.jsp")?"currentpage":""%>' href="./index" data-localize="ms_mainpage"></a>
				<a class='btn' href="http://www.supermapol.com" target="_blank" data-localize="nv_smonline"></a>
				<a class='btn' href="http://c.dituhui.com/apps" target="_blank" data-localize="nv_thememap"></a>
				<a class='btn' href="http://www.supermapol.com/web/maps" target="_blank" data-localize="ms_onlinemapping"></a>
				<a class='btn' href="http://runjs.cn/code" target="_blank" data-localize="ms_onlineDeclop"></a>
			</div>
			<div class="btn-group">
				<a class='btn' href="http://qa.supermap.com/" target="_blank" data-localize="ms_community"></a>
				<a class='btn <%=request.getServletPath().equals("/WorksShow.jsp")?"currentpage":""%>' href="./WorksShow" data-localize="ms_showground"></a>
				<%=request.getServletPath().equals("/index.jsp") && session.getAttribute("userid")==null?"":"<a class='btn "+ (request.getServletPath().equals("/master.jsp")?"currentpage":"") + "' href='./master' data-localize='ms_myCourse'></a>"%>
			</div >
		</div>

		<div id="userRole" class="nav navbar-nav dropdown" <%=uNameStyle%>>
			<!--下拉菜单-->
			<a class="dropdown-toggle" data-toggle="dropdown">
				<img class="userimg" src="./imgs/usr.png" />
				<span id="user" title='<%=nickname%>'><%=showNickname%></span>
				<!--用户名-->
				<span class="caret"></span>
			</a>
			<ul class="dropdown-menu">
				<li>
					<a href="myinfo" data-localize="nav_userinfo"></a>
				</li>
				<li>
					<a data-localize="nav_loginout" href="./logOut.jsp"></a>
				</li>
			</ul>
		</div>
	</div>